import 'package:get/get.dart';
import 'package:tushare_flutter/http/net/http_client.dart';
import 'package:tushare_flutter/http/net/http_response.dart';
import 'package:tushare_flutter/pojo/stock_detail_entity.dart';
import 'package:tushare_flutter/utils/log_utils.dart';

import 'state.dart';

class MainLogic extends GetxController {
  final MainState state = MainState();
  HttpClient dio = Get.find<HttpClient>();

  void queryBasicInfo(String code) async {
    HttpResponse appResponse = await dio.get("/hscp/gsjj/$code/12198A07-2229-4BAB-B3A7-0996329F4448");

    var response = StockDetailEntity.fromJson(appResponse.data);
    LogUtils.e("=name=${response.name}");
    LogUtils.e("=market=${response.market}");
    LogUtils.e("=principal=${response.principal}");
  }
}
